<div class="squareContent">
    <table class="squareBoard" width="100%" cellspacing="0" cellpadding="5">
        <thead>
            <tr class="squareBoardTitle">
                <td class="iconTitle">
                    类型</td>
                <td class="subjectTitle">
                    主题</td>
                <td class="releaseTimeTitle">
                    发布时间</td>
                <td class="releasePersonTitle">
                    发表人</td>
                <td class="deletePost"></td>
            </tr>
        </thead>
        <tbody>
        <% for post in @posts%>
            <tr>
                <td>
                    <%=post.squareClass.name %>
                </td>
                <td>
                    <%= link_to post.title,:action=>"post",:id=>post.id%></td>
                <td class="dateTime"><%=post.postDatetime.strftime("%Y-%m-%d %I:%M %p") %></td>
                <td><%=post.poster.username %></td>
                <td><%= link_to "删除",:action=>"delete",:id=>post.id %></td>
            </tr>
        <% end %>           
        </tbody>
    </table>
    <div class="pager">
        <ul>
            <% for page in @post_pages %>
                <%=
                if page==@post_pages.current()
                    "<li class='currentPage'>#{page.number}</li>"
                else
                    "<li><a href = '?page=#{page.number}' >#{page.number}</a></li>"
                end
                %>
            <% end %>
        </ul>
    </div>
</div>